.\" man page for sntpd and Larry Doolittle's ntpclient
.\" distributed under GPL
.\" originally written by Walter Harms
.Dd Dec 28, 2018
.\" Please adjust this date whenever revising the manpage.
.Dt SNTPD 8
.Sh NAME
.Nm sntpd
.Nd Simple NTP daemon and client
.Sh SYNOPSIS
.Nm
.Op Fl dhlnrtvV
.Op Fl i Ar SEC
.Op Fl p Ar PORT
.Op Fl q Ar MSEC
.Op SERVER
.Nm ntpclient
.Op Fl dlrst
.Op Fl c Ar count
.Op Fl f Ar frequency
.Op Fl g Ar goodness
.Op Fl h Ar hostname
.Op Fl i Ar interval
.Op Fl p Ar port
.Op Fl q Ar min_delay
.Sh DESCRIPTION
.Nm
is an NTP (RFC-1305) client for UNIX-alike computers.  Its functionality
is a small subset of xntpd, but has the potential to function better
within that limited scope.  Since it is much smaller than xntpd, it is
also more relevant for embedded computers.  It daemonizes itself by
default and starts synchronizing with the given NTP server, or
pool.ntp.org if no server is given, using default settings.
.Pp
.Nm
is a multicall binary.  When started as
.Nm ntpclient
it runs in a compatiblity mode with the original by Larry Doolittle and
produces output similar to this:
.Bd -unfilled -offset indent
Day    Second     Elapsed   Stall  Skew      Dispersion  Freq
36765  00180.386  1398.0    40.3   953773.9  793.5       -1240000
36765  00780.382  1358.0    41.3   954329.0  915.5       -1240000
36765  01380.381  1439.0    56.0   954871.3  915.5       -1240000
.Ed
.Pp
The columns have the following meaning:
.Pp
.Bl -tag -width DaysSeconds -compact -offset indent
.It Cm Day, Second
Time of measurement, UTC, relative to NTP epoch (Jan 1, 1900)
.It Cm Elapsed
Total time from query to response (microseconds)
.It Cm Stall
Time the server reports that it sat on the request (microseconds)
.It Cm Skew
Difference between local time and server time (microseconds)
.It Cm Dispersion
Reported by server, see RFC-1305 (microseconds)
.It Cm Freq
Local clock frequency adjustment (Linux only, ppm*65536)
.El
.Sh OPTIONS
The following options are supported by
.Nm
only.  See the
.Sx SYNOPSIS
section for available options for the
.Nm ntpclient
compat mode.  Note, if the
.Ar SERVER
argument is omitted,
.Nm
defaults to use pool.ntp.org.  This is also the most prominent
difference to
.Nm ntpclient
which requires a server hostname to be given as argument.
.Bl -tag -width Ds
.It Fl d
NTP debug/diagnostics, very noisy.
.It Fl h
Show summary of command line options and exit.
.It Fl i Ar interval
Check time every interval seconds, default 600.
.It Fl l
Use syslog instead of stdout for log messages, default unless started
with
.Fl n .
.It Fl n
Don't fork.  Prevents
.Nm
from daemonizing and also implies logging to stdout, use
.Fl l
to enable syslog in this mode.
.It Fl p Ar port
Local NTP client UDP port, default 0 means "any available".  Very rarely
necessary to change.
.It Fl q Ar min_delay
Minimum packet delay for transaction, default 800 microseconds.
.It Fl r
Replay analysis code based on stdin, feature is disabled by default
at compile time.
.It Fl t
Trust network and server, no RFC-4330 recommended cross-checks.
.It Fl v
Verbose operation.  This option will cause time sync events, and version
information at start/stop to be logged.
.It Fl V
Display version and copyright information.
.El
.Sh AUTHORS
Larry Doolittle maintains the original
.Nm ntpclient,
.Lk http://doolittle.icarus.com/ntpclient/ upstream
.Pp
Joachim Nilsson maintains this
.Nm
fork at
.Lk https://github.com/troglobit/sntpd GitHub
.Sh COPYRIGHT
The
.Nm ntpclient
project is Copyright 1997-2015 Larry Doolittle, and Copyright 2010-2018
Joachim Nilsson.   The fork by Joachim was renamed
.Nm
in December 2018, but like its ancestor it can be freely copied,
modified and used according to the terms of the GNU General Public
License, version 2.
.Sh "SEE ALSO"
.Xr adjtimex 1 ,
.Lk http://www.ntp.org
